﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Composition;
using MEF2Test.Contract;

namespace MEF2Test.ConsoleTest
{
	class ModelView
	{
		#region properties

		[ImportMany]
		public IEnumerable<IFanAddInEntry> Entries { get; set; }

		#endregion

		#region methods

		/// <summary>
		/// 执行所有插件。
		/// </summary>
		public void RunAllEntries()
		{
			if(Entries != null)
			{
				foreach (var item in Entries)
				{
					Console.WriteLine("Name: {0}, Description: {1}", item.Name, item.Description);
					item.Run();
				}
			}
			
		}

		#endregion

	}
}
